Xbasic

SQL::TableInfoParseTableName Method

Syntax

DIM result AS L = ParseTableName(C CatalogName, C SchemaName, C OwnerName, C TableName, C fullTableName)

Arguments

CatalogNameCharacter

The parsed catalog name.

SchemaNameCharacter

The parsed schema name.

OwnerNameCharacter

The parsed owner name.

TableNameCharacter

The parsed table name.

fullTableNameCharacter

The fully qualified table name to parse. Use brackets [] to wrap names with dots in them.

Returns

resultLogical

Returns .t. if the operation succeeds. Otherwise, .f..

Description

Parse a dot separated table name and return the components. Use brackets [] to wrap names with dots in them.

Discussion

The .ParseTableName() method takes a fully qualified table name and returns the base table name, owner, schema and catalog for the table. For example:

dim CatalogName as C
dim SchemaName as C
dim OwnerName as C
dim BaseTableName as C
dim FullName as C = "dbo.[hello.world]"
dim ti as sql::tableinfo 

? ti.ParseTableName(CatalogName, SchemaName, OwnerName, BaseTableName, FullName)
= .T.

? CatalogName
= ""

? SchemaName
= ""

? OwnerName
= "dbo"

? BaseTableName
= "dAgency.06"

? fullname
= "[dAgency.06]"